package com.tl.commonlibrary.ui.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;

import com.tubb.smrv.SwipeHorizontalMenuLayout;

/**
 * Created by Administrator on 2017/7/7 0007.
 */

public class SwipeHorizontalMenuEnableLayout extends SwipeHorizontalMenuLayout {
    public SwipeHorizontalMenuEnableLayout(Context context) {
        super(context);
    }

    public SwipeHorizontalMenuEnableLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public SwipeHorizontalMenuEnableLayout(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        if (!isSwipeEnable()) {
            return false;
        }
        return super.onInterceptTouchEvent(ev);
    }

    @Override
    public boolean onTouchEvent(MotionEvent ev) {
        if (!isSwipeEnable()) {
            return false;
        }
        return super.onTouchEvent(ev);
    }
}
